#!/usr/bin/env python
# Author: iris and jeff

PKG = 'sound_localization'

import roslib; roslib.load_manifest(PKG)
import rospy

from std_msgs.msg import String


class RunAudioLocalizer():
    def __init__(self):
        rospy.Subscriber("audio_loc_parameters", String, self.callback1)
        rospy.Subscriber("time_delay.data", String, self.callback2)
        self.pub = rospy.Publisher('sound source', String)
        rospy.init_node('run_audio_localizer', anonymous=True)
        while not rospy.is_shutdown():
            print "sound source is"
            self.pub.publish("sound source is" sound source )


    def callback1(self,data):
        try:
            print "run auio localizer just received" + audio_loc_parameters
        except rospy.ServiceException, e:
            print "Reply failed: %s"%e


    def callback2(self,data):
        try:
            print "run auio localizer just received" + time_delay.data
        except rospy.ServiceException, e:
            print "Reply failed: %s"%e


if __name__ == '__main__':
    try:
        st = RunAudioLocalizer()
        rospy.spin()
    except rospy.ROSInterruptException:
        pass
